// packageB/pages/syudy/skill/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

    dayNum:0,
    sumNum:0,
    typeList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: '面试宝典',
    });
    this.getQuNum();
  },
  onShow(){
    this.getReadNum();
    this.getSumReadNum();
  },
  //去面试宝典
  goToInterview(e){
    let type  = e.currentTarget.dataset.type
    wx.setStorageSync('bankType', type)
    wx.navigateTo({
      url: '/packageB/pages/syudy/interview/select/index',
    })
  },
  
  //获取阅读总数
  getReadNum(){
    wx.http.get(getApp().globalData.getReadNum,{
      recordsType:2,
      dayType:1
    }).then(res=>{
      this.setData({
        dayNum:res.data
      })
    })
  },
  //获取阅读总数
  getSumReadNum(){
    wx.http.get(getApp().globalData.getReadNum,{
      recordsType:2
    }).then(res=>{
      this.setData({
        sumNum:res.data
      })
    })
  },
  //获取题库总题数
  getQuNum(){
    wx.http.get(getApp().globalData.getQuNum).then(res=>{
      if(res.code ==200){
        this.setData({
          typeList:res.data
        })
      }
    })

  }
})

